import {Component, Input, OnInit} from '@angular/core';
import {HeroService} from "../hero.service";
import {Hero} from "../hero";
import {ActivatedRoute} from "@angular/router";

@Component({
  selector: 'app-dashbord',
  templateUrl: './dashbord.component.html',
  styleUrls: ['./dashbord.component.css'],
  providers:[HeroService]
})
export class DashbordComponent implements OnInit {
  heroes: Hero[];
  selectedHero: Hero;
  constructor(private heroService: HeroService,private route:ActivatedRoute) { }

  ngOnInit() {
    this.heroService.getHeros().then(heroes => this.heroes = heroes.slice(1, 5));
  }
}
